﻿<%@ Page Title="角色主表维护" Language="C#" MasterPageFile="~/masterPage/admin/Manage.master"
    AutoEventWireup="true" CodeFile="ManageRoles.aspx.cs" Inherits="ManageRoles" %>

<%@ MasterType VirtualPath="~/masterPage/admin/Manage.master" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
    <div>
        <table cellspacing="0" cellpadding="4" class="Retrieval">
            <tr class="Retrieval_T">
                <td width="60" rowspan="2">
                    <font>显示<br />
                        条件</font>
                </td>
                <td width="70">
                    <font>编号</font>
                </td>
                <td>
                    <font>角色名称</font>
                </td>
                <td>
                    <font>单位</font>
                </td>
                <td width="80">
                    <font>条件设置</font>
                </td>
            </tr>
            <tr align="center" class="Retrieval_C">
                <td>
                    <asp:TextBox ID="tb_mg_id" CssClass="tb_mg_id" runat="server" MaxLength="5"></asp:TextBox>
                </td>
                <td>
                    <asp:TextBox ID="tb_RoleName" CssClass="tb_RoleName" runat="server" MaxLength="20"></asp:TextBox>
                </td>
                <td>
                    <asp:TextBox ID="tb_Description" CssClass="tb_Description" runat="server" MaxLength="20"></asp:TextBox>
                </td>
                <td>
                    <asp:Button ID="Btn_Set" CssClass="Btn_Set" runat="server" Text="索引" OnClick="Btn_Set_Click" />
                </td>
            </tr>
        </table>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
        <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
            <telerik:RadGrid runat="server" ID="gv_Role" AllowPaging="True" AllowSorting="True"
                AutoGenerateColumns="False" Width="97%" ShowStatusBar="True" GridLines="Both"
                PageSize="10" OnUpdateCommand="gv_Role_UpdateCommand" OnInsertCommand="gv_Role_InsertCommand"
                OnDeleteCommand="gv_Role_DeleteCommand" OnItemCommand="gv_Role_ItemCommand" CssClass="gv_Role">
                <PagerStyle Mode="NumericPages" AlwaysVisible="true" />
                <MasterTableView Width="100%" CommandItemDisplay="Top" DataKeyNames="RoleId" EditMode="PopUp">
                    <NoRecordsTemplate>
                        没有任何管理员的数据！</NoRecordsTemplate>
                    <CommandItemSettings AddNewRecordText="创建新角色" ShowRefreshButton="true" ShowAddNewRecordButton="true"
                        RefreshText="刷新数据"></CommandItemSettings>
                    <Columns>
                        <telerik:GridTemplateColumn HeaderText="编号" UniqueName="mg_id" SortExpression="mg_id"
                            ReadOnly>
                            <%--ning --%>
                            <ItemTemplate>
                                <asp:Label runat="server" ID="lblRoleNo" Text='<%# Eval("mg_id") %>' />
                            </ItemTemplate>
                            <EditItemTemplate>
                                <telerik:RadTextBox runat="server" ID="rtbRoleNo" Text='<%# Bind("mg_id") %>' />
                            </EditItemTemplate>
                            <HeaderStyle Width="10%" />
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="角色名称" UniqueName="RoleName" DataField="RoleName"
                            SortExpression="RoleName">
                            <ItemTemplate>
                                <asp:Label ID="lblRoleName" runat="server" Text='<%# Bind("RoleName") %>' />
                            </ItemTemplate>
                            <EditItemTemplate>
                                <telerik:RadTextBox ID="rtbRoleName" runat="server" EmptyMessage="请输入角色名称" Text='<%# Bind("RoleName") %>' />
                                <asp:RequiredFieldValidator ID="Requiredfieldvalidator2" runat="server" ControlToValidate="rtbRoleName"
                                    ValidationGroup="validateCompanyProduct" ErrorMessage="请输入角色名称" Display="Dynamic"
                                    SetFocusOnError="true" />
                            </EditItemTemplate>
                            <ItemStyle VerticalAlign="Top" />
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="内容" UniqueName="Description" DataField="Description"
                            SortExpression="Description">
                            <ItemTemplate>
                                <asp:Label ID="lblDescription" runat="server" Text='<%# Bind("Description") %>' />
                            </ItemTemplate>
                            <EditItemTemplate>
                                <telerik:RadTextBox ID="rtbDescription" runat="server" TextMode="MultiLine" EmptyMessage="描述一下角色的内容吧..."
                                    Text='<%# Bind("Description") %>' />
                                <asp:RequiredFieldValidator ID="Requiredfieldvalidator1" runat="server" ControlToValidate="rtbDescription"
                                    ValidationGroup="validateCompanyProduct" ErrorMessage="描述一下角色的内容吧..." Display="Dynamic"
                                    SetFocusOnError="true" />
                            </EditItemTemplate>
                            <ItemStyle VerticalAlign="Top" />
                        </telerik:GridTemplateColumn>
                        <telerik:GridButtonColumn HeaderText="删除" Text="删除" CommandName="Delete" ButtonType="ImageButton"
                            ConfirmTitle="确认删除" ConfirmText="确认您要删除该角色吗？">
                            <HeaderStyle Width="2%" />
                        </telerik:GridButtonColumn>
                    </Columns>
                    <EditFormSettings>
                        <EditColumn ButtonType="ImageButton" CancelText="取消" InsertText="新建" />
                    </EditFormSettings>
                    <PagerStyle AlwaysVisible="False"></PagerStyle>
                </MasterTableView>
                <ValidationSettings ValidationGroup="validateCompanyProduct" />
            </telerik:RadGrid>
        </telerik:RadAjaxPanel>
    </div>
</asp:Content>
